package com.example.tliasmanagement.controller;

import com.example.tliasmanagement.aop.MyLog;
import com.example.tliasmanagement.aop.MyLog1;
import com.example.tliasmanagement.dto.LoginDto;
import com.example.tliasmanagement.service.EmpService;
import com.example.tliasmanagement.vo.LoginResultVo;
import com.example.tliasmanagement.vo.Result2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录
 */
@RestController
public class LoginController {
    @Autowired
    private EmpService empService;

    @MyLog1
    @PostMapping("/login")
    public Result2<LoginResultVo> login(@RequestBody LoginDto dto) {
        LoginResultVo vo = empService.login(dto);
        return Result2.ok(vo);
    }
}
